package day05work_c;

import java.util.Random;

public class Lambda_test03 {

    public static void useRandomNumHandler(RandomNumHandler randomNumHandler){

        randomNumHandler.getNumber();

    }

    public static void main(String[] args) {
        useRandomNumHandler(new RandomNumHandler() {
            @Override
            public int getNumber() {

                Random random=new Random();
                int num= random.nextInt();
                return num;
            }
        });
        useRandomNumHandler(()->{
            Random random=new Random();
            int num= random.nextInt();
            return num;

        });
    }

}
